format: a CSV can be as narrow or as wide as the thing you are testing - #47
Merged
Conversation
Adds columns to the csv format, from 2 to 32768, six by default. Six is the six columns this tool has always written, so nothing anybody already generates moves by a byte - the three pinned csv hashes are unchanged and that is the whole claim this setting makes. Fewer than six drops them from the MIDDLE. id stays first and description stays last, because description is the field the closing row stretches to reach the exact size that was ordered - put it anywhere else and the padding lands inside a record while the length stays perfect. More than six adds field_7, field_8 and so on in front of it. Column TYPES stay out of this: they have their own place in the backlog, and half a type system built here would be the harder half to take back. The ceiling was chosen by measuring other people's readers rather than from memory. LibreOffice Calc headless, tables written by hand: 16384 columns come back whole, 16385 comes back with 16384 and the last column gone without a word, 32768 comes back as 16384 in three seconds. Python's csv module and our own checker take all of them. So the ceiling sits deliberately ABOVE that line. Building the set either side of a boundary is what this tool is for, and stopping at 16384 would offer the last table that survives and not the first that does not. Copying the 64 that xlsx uses was rejected: that number is justified by a sheet built in memory and by the width a person looks at, and neither applies to a format that is streamed. Borrowing someone else's reason is worse than having none. The floor is two, and for three reasons rather than one. A table of one column carries no separator anywhere, so a file written with the wrong one is byte for byte a file written with the right one - our own structural check refuses such a file for exactly that reason. It would leave the delimiter setting doing nothing, which this project treats as a refusal rather than a silence. And one column of values is a txt file, which this tool already writes. The floor moves with the width, as it already does for row endings and quoting: 36 B at two columns, 115 B at six, 5017 B at 256, 709793 B at the ceiling. Measured with the binary, twelve widths, all distinct. The structural checker is now told the width and asserts it, which is stronger than what it did before. Counting can only ask whether the rows agree with each other, and a table that wrote five columns where six were ordered agrees with itself perfectly at exactly the right length. Verified: 150 files swept over ten widths, three quote styles and five sizes from each floor upward - exact size, exact width under both Go's encoding/csv and Python's module, and the manifest agreeing with the file. 19 of 19 mutations caught. Two guards were wrong before this and are fixed here. The one written for quote_style counted separators as "minus five", which was right only because it never changed the width - it asks the plan now. And the manifest guard never checked the column count at all. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
columnsto thecsvformat, from 2 to 32768, six by default.Nothing anybody already generates moves by a byte. Six is the six columns
this tool has always written, and the three pinned
csvhashes are unchanged -which is the whole claim this setting makes. A fourth case pins a width of
seventeen from the day it exists.
Which columns go, and which stay
Fewer than six drops them from the middle.
idstays first anddescriptionstays last, becausedescriptionis the field the closing rowstretches to reach the exact size that was ordered - put it anywhere else and
the padding lands inside a record while the length stays perfect. More than six
adds
field_7,field_8and so on in front of it.Column types stay out of this. They have their own place in the backlog, and
half a type system built here would be the harder half to take back.
The ceiling was measured, not recalled
LibreOffice Calc headless, tables written by hand, three readers asked at once:
csvSo the ceiling sits deliberately above that line. Building the set either
side of a boundary is what this tool is for, and stopping at 16384 would offer
the last table that survives and not the first that does not.
Copying the
64thatxlsxuses was rejected: that number is justified by asheet built in memory and by the width a person looks at, and neither applies to
a format that is streamed. Borrowing someone else's reason is worse than having
none.
The floor is two, for three reasons
A table of one column carries no separator anywhere, so a file written with the
wrong one is byte for byte a file written with the right one - our own
structural check refuses such a file for exactly that reason. It would also
leave
delimiterdoing nothing, which this project treats as a refusal ratherthan a silence. And one column of values is a
txtfile, which this toolalready writes.
The floor moves with the width, as it already does for row endings and quoting:
36 B at two columns, 115 B at six, 5017 B at 256, 709793 B at the
ceiling. Twelve widths measured with the binary, all distinct.
Verified
floor upward. Exact size, exact width under both Go's
encoding/csvandPython's module, and the manifest agreeing with the file.
stronger than what it did before: counting can only ask whether the rows agree
with each other, and a table that wrote five columns where six were ordered
agrees with itself perfectly at exactly the right length. Negative controls
both ways.
Two guards were wrong before this
The one written for
quote_styleyesterday counted separators as "minus five",because six fields need five. That was right only because it never changed the
width - it asks the plan now. And the manifest guard never checked the column
count at all.
Full suite,
preflight --quick(12 of 12, including the three CI-only checks)green locally. Two failures were caught by preflight rather than by the targeted
runs:
parseDialectcrossed the branching band and needed splitting, and thechangelog entry had created a second
### Addedheading.🤖 Generated with Claude Code